package club.kingyin.easycache.component.config;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author ：kingyin
 * @date ：创建于 2022/12/20 21:31
 * @description ：全局配置中心
 * @modified By：
 * @version: 1.0.0
 */
public class CacheConfiguration {

    private static Map<String, Object> config = new ConcurrentHashMap<>();

    public static Object get(String key) {
        return config.get(key);
    }

    public static Object getOrDefault(String key, Object def) {
        return config.getOrDefault(key,def);
    }

    public static void set(String key, Object value) {
        config.put(key, value);
    }

    public static boolean contains(String key) {
        return config.containsKey(key);
    }
}
